<template>
    <div>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <i class="el-icon-lx-edit"></i> 配置管理
                </el-breadcrumb-item>
                <el-breadcrumb-item>拼团奖励配置</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="form-box">
            <el-form ref="edit" style="width:600px" :model="data" label-width="150px">
               <!-- <el-form-item label="直推奖励" style="width:100%">
                    <el-input v-model="data.direct" maxlength="50" placeholder="请输入直推奖励百分比"></el-input>
                </el-form-item>
                <p class="tips">
                    <span>注意:</span> 用户等级中的配置权重高于此处配置，如果用户有等级奖励则会覆盖此配置
                </p>-->
                <el-form-item label="拼团中奖锁定比例" style="width:100%">
                    <el-input v-model="data.coin_yes" maxlength="100" placeholder="请输入拼团中奖锁定比例百分比"></el-input>
                </el-form-item>
                <el-form-item label="拼团不中奖反佣比例" style="width:100%">
                    <el-input v-model="data.coin_no" maxlength="100" placeholder="请输入拼团不中奖反佣比例百分比"></el-input>
                </el-form-item>
                <el-form-item label="拼团不中奖返还天数" style="width:100%">
                    <el-input v-model="data.coin_no_num" maxlength="100" placeholder="拼团不中奖返还天数"></el-input>
                </el-form-item>
                <el-form-item label="每天释放锁定比例" style="width:100%">
                    <el-input v-model="data.coin_no_day" maxlength="100" placeholder="每天释放锁定积分比例"></el-input>
                </el-form-item>
                <div class="but-box">
                    <el-button type="primary" @click="saveData">保 存</el-button>
                </div>
            </el-form>
        </div>
    </div>
</template>

<script>
export default {
  data () {
    return {
      data: {
        direct: '',
        coin_yes: 0,
        coin_no: 0,
        coin_no_num: 0,
        coin_no_day: 0,
      },
      getInfo () {
        this.api.get('getGroupConfig', {}, res => {
          this.data = res.data.info;
        });
      }
    }
  },

  created () {
    this.getInfo();
  },

  methods: {


    /**
     * 保存事件
     */
    saveData () {
      this.api.put('editGroupConfig', this.data, res => {
        this.getInfo();
        this.$message.success('保存成功');
      });
    },

  }
}
</script>

<style  scoped>
.form-box {
    min-width: 360px;
    width: 90%;
    min-height: 70vh;
    padding: 2vh 2vh;
    background: #ffffff;
}
.but-box {
    width: 100%;
    height: auto;
    display: flex;
    flex-flow: nowrap row;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
}
.tips {
    width: auto;
    color: rgb(160, 160, 161);
    font-size: 12px;
}
.tips a {
    color: #70afef;
}
.tips > span {
    color: rgb(233, 142, 154);
}
</style>